package com.shujia.wyh.day18;

public class EnumDemo3 {
    public static void main(String[] args) {
        Season3 spring = Season3.SPRING;
        spring.activity();
        Season3 summer = Season3.SUMMER;
        summer.activity();
    }
}


interface Activity{
    void activity();
}


enum Season3 implements Activity{
    //3、在枚举类中创建对象，因为外界无法创建对象，又想让外界获取，所以改成静态的，可以直接通过类名访问
    //在enum修饰的枚举类中必须放在第一个位置。！！
    SPRING("春天", "春暖花开"),
    SUMMER("夏天", "烈日炎炎"),
    FALL("秋天", "秋高气爽"),
    WINTER("冬天", "白雪皑皑");

    //2、创建枚举类的属性（成员变量）,外界不能去修改也不能进行直接获取
    private final String SEASON_NAME;
    private final String SEASON_DESC;


    //1、必须将构造方法私有化，这样做的目的是为了保证类的对象是有限个的
    private Season3(String SEASON_NAME, String SEASON_DESC) {
        this.SEASON_NAME = SEASON_NAME;
        this.SEASON_DESC = SEASON_DESC;
    }



    //4、提供公共的方法获取属性
    public String getSEASON_NAME() {
        return SEASON_NAME;
    }

    public String getSEASON_DESC() {
        return SEASON_DESC;
    }

    @Override
    public void activity() {
        System.out.println("好好学习天天向上");
    }
}
